package com.kun.demo01;

//创建线程的方式2：实现Runnable接口
public class ThreadCreate02 implements Runnable {

    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("我正在写代码: " + i);
        }
    }

    public static void main(String[] args) {
        ThreadCreate02 threadCreate02 = new ThreadCreate02();
        new Thread(threadCreate02).start();
        for (int i = 0; i < 1000; i++) {
            System.out.println("我在学习多线程: " + i);
        }
        System.out.println("主线程结束");
    }
}
